package PrimitiveDataStructures;

import java.util.List;

import RelUtilityClasses.InstanceNode;

/**
 * 
 * A factory class with a factory function to create instances of different 
 * primitive key-value associative map data structures.
 * 
 * @author Yevgeny Levanzov & Daniel Samuelov
 *
 */
public class DSFactory {

    /**
     * 
     * A factory method for creating instances of different 
     * primitive key-value associative map data structures.
     * 
     * @param ds an enum value of desired data structure
     * 
     * @return an instance of primitive key-value associative map data structure, by given input
     * 
     */
    public static KeyValueDataStructure<List<String>,InstanceNode> getDS(PrimitiveDS ds) {
    	
    	switch (ds) {
    	
        case HTABLE: 
        	return new MyHashTable<List<String>,InstanceNode>();
        case LIST:
        	return new MyLinkedList<List<String>,InstanceNode>();
        case VECTOR:
        	return new MyVector<List<String>,InstanceNode>();
        case BTREE:
        	return new MyBinaryTree<List<String>,InstanceNode>();
    	}
    	 
    	//we never get here.
    	return null;
    	
    }
    
}
